package com.renfei.multimediatask.util;

import android.graphics.SurfaceTexture;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.TextureView;

public abstract class CameraLoader {

    protected OnPreviewFrameListener onPreviewFrameListener;


    public void setOnPreviewFrameListener(OnPreviewFrameListener onPreviewFrameListener) {
        this.onPreviewFrameListener = onPreviewFrameListener;
    }


    public abstract void onCreate(int width, int height,OnPreviewSelectListener onPreviewSelectListener);


    public abstract void startPreViewSurfaceHolder(SurfaceHolder surfaceHolder);

    public abstract void startPreViewTextureView(SurfaceTexture surfaceTexture);

    public abstract void onPause();

    public abstract void swithCamera();

    public abstract int getCameraOrientation();

    public abstract boolean hasMultipleCamera();


    public interface OnPreviewFrameListener {
        void onPreviewFrame(byte[] data, int width, int height);
    }


    public interface OnPreviewSelectListener {
        void onPreviewSizeSelect(int width, int height);
    }

}
